package com.zxl.finance.service.impl;

import com.zxl.finance.domain.PaymentInfo;
import com.zxl.finance.repository.PaymentInfoRepository;
import com.zxl.finance.service.PaymentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;


/**
 * @auther: zxl
 * @creater: 2018-07-13
 * @description: paymentInfoService的实现
 **/
@Service
public class PaymentInfoServiceImpl implements PaymentInfoService {

    @Autowired
    private PaymentInfoRepository paymentInfoRepository;

    @Override
    public PaymentInfo getById(String id) {
        Optional<PaymentInfo> t =paymentInfoRepository.findById(id);
        return t.isPresent()?t.get():null;
    }

    @Override
    public PaymentInfo save(PaymentInfo paymentInfo) {
        return paymentInfoRepository.save(paymentInfo);
    }
}
